<template>
    <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage1"
      :page-size="searchlist.pageSize"
      layout="total, prev, pager, next"
      :total="total">
   
    </el-pagination>
  </div>
</template>

<script>
export default {
props:['searchlist'],
name:'Pagenation',
 methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);    
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
       this.searchlist.pageNo = val
     this.$store.dispatch("search", this.searchlist);

      }
    },
    data() {
      return {
        currentPage1: 1,
      };
    },
    computed:{
      total(){
      return  this.$store.state.Search.search.total
      },   
    }
  
}
</script>

<style lang="less" scoped>
.block{
  text-align: center;
}
</style>